package sy.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.log4j.Logger;

import sy.dao.SysRoleDaoI;
import sy.model.SysRole;
import sy.service.SysRoleServiceI;

@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleServiceI {
	
	private static final Logger logger = Logger.getLogger(SysRole.class);
	private SysRoleDaoI sysRoleDao;


	public SysRoleDaoI getSysRoleDao() {
		return sysRoleDao;
	}

	@Autowired
	public void setSysRoleDao(SysRoleDaoI sysRoleDao) {
		this.sysRoleDao = sysRoleDao;
	}

	@Override
	public Serializable save(SysRole sysRole) {
		
		return sysRoleDao.save(sysRole);
	}

	@Override
	public void remove(String[] ids) {
		// TODO Auto-generated method stub
		for (int i = 0; i < ids.length; i++) {
			SysRole sysRole = sysRoleDao.getSysRoleById(ids[i]);
			sysRoleDao.remove(sysRole);
		}
	}

	/* (non-Javadoc)
	 * @see sy.service.SysRoleServiceI#update(sy.model.SysRole)
	 */
	@Override
	public void update(SysRole sysRole) {
		// TODO Auto-generated method stub
		sysRoleDao.update(sysRole);
	}

	/* (non-Javadoc)
	 * @see sy.service.SysRoleServiceI#list()
	 */
	@Override
	public List<SysRole> list() {
		// TODO Auto-generated method stub
		return sysRoleDao.list();
	}

	/* (non-Javadoc)
	 * @see sy.service.SysRoleServiceI#getSysRoleById(java.lang.String)
	 */
	@Override
	public SysRole getSysRoleById(String id) {
		// TODO Auto-generated method stub
		return sysRoleDao.getSysRoleById(id);
	}

	/* (non-Javadoc)
	 * @see sy.service.SysRoleServiceI#listSysRoleByKey(java.lang.String)
	 */
	@Override
	public List<SysRole> listSysRoleByKey(String key) {
		// TODO Auto-generated method stub
		return sysRoleDao.listSysRoleByKey(key);
	}



}
